<template>
	<view class="center">
		<view class="center_top">
		</view>
		<view class="center_box_bg">
			<view class="profily">
				<view class="base">
					<view class="profily_header">
					</view>
					<text><b>陈彬</b></text>
					<image src="../../static/setting.png" mode=""></image>
				</view>
				<view class="order_status">
					<view class="status" v-for="item in status">
						<text><b>{{item.name}}</b></text>
					</view>
				</view>
			</view>
			<view class="baiban"></view>
			<!-- 积分和班级信息 -->
			<view class="card">
				<view><text class="t1">1253</text><text class="t2">积分</text></view>
				<view class="t3">19级网络工程3班</view>
			</view>
			<!-- 宫格 -->
			<u-grid style="margin-top: 60rpx;" :border="false" col="3" >
				<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex" :name="listItem.name" @click="click">
					<u--image :src="listItem.url" width="100rpx" height="100rpx">
					</u--image>
					<text class="grid-text">{{listItem.name}}</text>
				</u-grid-item>
			</u-grid>
			<u-toast ref="uToast" />
			<!-- 分割线 -->
			<view class="line2"></view>
			<!-- 底部 -->
			<u-toast ref="uToast"></u-toast>
			<u-cell-group title-bg-color="rgb(243, 244, 246)">
				<u-cell :titleStyle="{fontWeight: 500}" :title="item.title" v-for="(item, index) in list2" :key="index"
					isLink :icon="item.iconUrl" @click="showToast(item)">
				</u-cell>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				status: [{
						key: 1,
						name: '收藏'
						// url: ''
					},
					{
						key: 2,
						name: '订阅'
					},
					{
						key: 3,
						name: '历史'
					}
				],
				list: [{
						name: '学习积分',
						url: '../../static/liebiao/1.png',
						title: '学习积分'
					},
					{
						name: '强国城',
						url: '../../static/liebiao/2.png',
						title: '强国城'
					},
					{
						name: '我要答题',
						url: '../../static/liebiao/3.png',
						title: '我要答题'
					},
					{
						name: '学习报表',
						url: '../../static/liebiao/4.png',
						title: '学习报表'
					},
					{
						name: '强国视频会议',
						url: '../../static/liebiao/5.png',
						title: '强国视频会议'
					},
					{
						name: '我要留言',
						url: '../../static/liebiao/6.png',
						title: '我要留言'
					},
					{
						name: '服务电话',
						url: '../../static/liebiao/7.png',
						title: '服务电话'
					},
					{
						name: '咨询',
						url: '../../static/liebiao/8.png',
						title: '咨询'
					},
					{
						name: '强国云盘',
						url: '../../static/liebiao/9.png',
						title: '强国云盘'
					},
					{
						name: '防疫健康码',
						url: '../../static/liebiao/10.png',
						title: '团圆'
					},
					{
						name: '强国应用',
						url: '../../static/liebiao/11.png',
						title: '强国应用'
					},
					{
						name: '强国运动',
						url: '../../static/liebiao/12.png',
						title: '强国运动'
					},
					{
						name: '我的书架',
						url: '../../static/liebiao/13.png',
						title: '我的书架'
					},
					{
						name: '强国医生',
						url: '../../static/liebiao/14.png',
						title: '强国医生'
					},
					{
						name: '防疫健康码',
						url: '../../static/liebiao/15.png',
						title: '防疫健康码'
					},
				],
				show: false,
				list2: [{
						type: 'error',
						icon: false,
						title: '我的红包',
						message: "暂时关闭该功能",
					},
					{
						type: 'success',
						title: '使用手册',
						message: "你点击了使用手册",
					}

				],

			}
		},
		methods: {
			click(name) {
				console.log(name)
				this.$refs.uToast.success(`点击了${name}`)
			},

			showToast(params) {
				this.$refs.uToast.show({
					...params,
					complete() {
						params.url && uni.navigateTo({
							url: params.url
						})
					}
				})
			}

		},
		computed: {

		},

	}
</script>

<style lang="scss">
	.grid-text {
		font-size: 14px;
		color: #909399;
		padding: 10rpx 0 20rpx 0rpx;
		/* #ifndef APP-PLUS */
		box-sizing: border-box;
		/* #endif */
	}

	page {
		height: 100%;
	}

	.profily,
	.profily_header {
		border-radius: 4px;
	}

	.center {
		height: 100%;

		&_top {
			height: 10%;
			background-color: #e32519;
			background-size: cover;

			// background: #E6E6E6;

		}

		&_box_bg {
			background: #ffffff;
			position: relative;

			.profily {
				position: absolute;
				width: 90%;
				// border:1px solid #F7F7F7;
				margin: 0 auto;
				top: -100rpx;
				left: 5%;
				background: #ffffff;
				padding: 26rpx;
				box-sizing: border-box;
				box-shadow: 0px 4px 6px #d5d5d5;
			}
		}
	}

	.base {
		display: flex;
		align-items: center;
		border-bottom: 2px solid #ffffff;
		padding-bottom: 10rpx;
		position: relative;

		.profily_header {
			height: 100rpx;
			width: 100rpx;
			background-image: url(../../static/logo.png);
			background-size: 100%;
			border-radius: 50%;
		}

		text {
			margin-left: 20px;
			font-size: 30rpx;
		}

		image {
			position: absolute;
			height: 40rpx;
			width: 40rpx;
			right: 0px;
			top: 0px;
		}
	}

	.order_status {
		display: flex;
		text-align: center;
		justify-content: space-between;
		margin-top: 35upx;

		.status {
			width: 140upx;
			font-size: 24upx;
			text-align: center;
			letter-spacing: .5px;
			display: flex;
			justify-content: space-around;
		}
	}

	.baiban {
		background: #FEFEFE;
		height: 160upx;
	}

	.card {
		display: flex;
		text-align: center;
		justify-content: space-between;
		width: 90%;
		margin-left: 5%;
		height: 100rpx;
		box-shadow: 0px 4px 6px #d5d5d5;

		.cc {
			padding-top: 10rpx;
		}

		.t1 {
			color: #e32519;
			font-size: 50rpx;
			font-weight: 600;
			margin-left: 50rpx;
		}

		.t2 {
			color: #e32519;
			font-size: 14rpx;
			font-weight: 600;
			padding-left: 10rpx;
		}

		.t3 {
			color: #868686;
			font-size: 14rpx;
			padding-right: 10%;
			margin-top: 25rpx;

		}
	}
	.line2{
		
		height: 8rpx;
		width: 90%;
		margin-top: 30rpx;
		margin-left: 5%;
		background-color: red;
		
	}
	.u-cell-group {
		font-weight: bold;
		padding-left:2%;
		margin-top: 12rpx;
	}
</style>
